1. Field of the Invention
The invention relates to data communication, and more particularly to communication of image data.
2. Description of the Related Art
Ordinarily, a memory of a host comprises a virtual frame buffer for storing all pixel data to be displayed on a screen. A graphic card corresponding to the screen also comprises a frame buffer for storing all pixel data to be displayed on the screen. When a user of the host inputs a character via a keyboard, because a character image corresponding to the input character must be shown on the screen, the host must first store the character image to the virtual frame buffer of the host, and then transmit the character image from the host to the graphic card to be stored to the frame buffer of the graphic card.
Referring to FIG. 1, a schematic diagram of a virtual frame buffer 110 of a host and a frame buffer 120 of a graphic card is shown. Assume that a character image 112 corresponding to a character input by a user has been stored in the virtual frame buffer 110, wherein the character image has a width of w pixels and a height of h pixels, and a pixel on an upper-left corner of the character image 112 has an address PV0 in the virtual frame buffer 110. To show the character image 112 input by the user on the screen, the host must transmit the character image 112 to the frame buffer 120 of the graphic card. Referring to FIG. 2, a flowchart of a method 200 for transmitting a character image to a frame buffer of a display device is shown.
First, a user inputs a character to an input device (such as a keyboard) of a host (step 202). The host then stores a character image 112 corresponding to the character to a virtual frame buffer 110 of the host (step 204). Because the character image has a height of h pixels, the host divides the character image into h rows of pixels, and each row comprises w pixels (step 206). The host then transmits a first row of pixels of the character image to the display device to be stored in the frame buffer 120 with a starting address of offset0 (step 211). Assume that the width of the screen is pitch. The host then transmits a second row of pixels of the character image to the display device to be stored in the frame buffer 120 with a starting address of (offset0+pitch) (step 212). Each row of pixels of the character image is then respectively transmitted to the frame buffer of the display device, until an h-th row of pixels of the character image is transmitted to the display device to be stored in the frame buffer 120 with a starting address of (offset0+(h−1)×pitch) (step 21h).
The aforementioned data transmission method has deficiencies. Because each data transmission must transmit a plurality of protocol packets comprising sync packets, command packets, and frame packets according to a USB protocol, when the frequencies of data transmission is greater, the data amount of the protocol packets to be transmitted is greater, and the data processing load of the host is heavier. For example, when a character image is divided into a plurality of rows of pixels to be transmitted to the frame buffer, the efficiency of data transmission is lowered due to the protocol packets to be transmitted. In addition, when a user inputs a character, the host directly transmits the character image to the display device. If the user continuously inputs a series of characters, the host transmits the characters to the display device, and the efficiency of data transmission is further reduced. In addition, each USB data transmission must initiate software and hardware on transmission terminals and receiving terminals, and a delay is therefore caused. Thus, a method for transmitting data from an electronic apparatus to a display device is therefore required to improve the efficiency of data transmission.